from building import *

cwd = GetCurrentDir()
CPPPATH = [cwd]

src = []

if GetDepend('SUPPORT_CBOOT'):
  src += Glob('cBootDcl.c')

if GetDepend('SUPPORT_APP_WR_BOOT'):
  if GetDepend('SUPPORT_BOOT_IN_FLASH'):
    src += Glob('cBootDcl_BootInFlash.c') 
  if GetDepend('SUPPORT_APP_WR_BOOT_EXSAMPLE'):
    src += Glob('cBootDcl_AppExsample.c') 
else:
  if GetDepend('SUPPORT_CBOOT_TO_FLASH'):
    src += Glob('cBootDcl_App.c') 
  if GetDepend('SUPPORT_CBOOT_FROM_SD'):
    src += Glob('cBootDcl_AppSd.c')
  if GetDepend('SUPPORT_CBOOT_STATE_NOTE'):
    if GetDepend('SUPPORT_CBOOT_STATE_EXSAMPLE'):  
      src += Glob('cBootDcl_cbStateExsample.c') 
  if GetDepend('SUPPORT_CBOOT_APP_EXSAMPLE'):
    src += Glob('cBootDcl_App_cbExsample.c') 

if GetDepend('SUPPORT_CBOOT_CRYPTO_EXSAMPLE'):
  src += Glob('cBootDclCrypto_Exsample.c') 

#增加SUPPORT_EX_PREINCLUDE定义以预包含Preinclude.h
predefine = ['SUPPORT_EX_PREINCLUDE']
group = DefineGroup('cBoot', src, depend = [''], CPPPATH=CPPPATH, CPPDEFINES = predefine)
Return('group')


